// Jarvis select2 theme

.select2-container--jarvis {

  .select2-selection--single {
    height: $select2-height;
    padding: 6px 24px 6px 12px;
    border: 1px solid $select2-border;
    border-radius: $select2-border-radius;

    .select2-selection__rendered {
      padding: 0;
      color: $select2-color;
    }

    .select2-selection__arrow {
      position: absolute;
      top: 1px;
      right: 1px;
      width: 24px;
      height: $select2-height - 2;

      b {
        position: absolute;
        height: 0;
        left: 50%;
        top: 50%;
        width: 0;
        margin-left: -$select2-arrow-size;
        margin-top: -$select2-arrow-size;
        border-style: solid;
        border-color: transparent;
        border-top-color: $select2-arrow-bg;
        border-width: $select2-arrow-size;
        border-bottom-width: 0;
      }
    }
  }

  .select2-selection--multiple {
    border: 1px solid $select2-border;
    border-radius: $select2-border-radius;

    .select2-selection__rendered {
      display: block;
      margin-bottom: 0;
      padding-left: 0;
      list-style: none;
    }

    .select2-selection__choice {
      float: left;
      margin: 5px 0 0 6px;
      padding: 0 6px;
      background-color: #fff;
      border: 1px solid $select2-border;
      border-radius: $select2-border-radius;
      color: $select2-color;
    }

    .select2-selection__choice__remove {
      display: inline-block;
      margin-right: 3px;
      font-weight: 700;
      cursor: pointer;
      color: lighten($select2-color, 15%);

      &:hover {
        color: darken($select2-color, 15%);
      }
    }

    .select2-search--inline .select2-search__field {
      height: $select2-height;
      min-width: 5em;
      margin-top: 0;
      padding: 0 12px;
      outline: none;
    }
  }

  .select2-selection--single,
  .select2-selection--multiple {
    &:focus {
      outline: 0;
      border-color: $select2-focus-border;
    }
  }

  &.select2-container--open {
    .select2-selection {
      border-color: $select2-focus-border;
      transition: border-color ease-in-out .15s;
    }

    .select2-selection--single {
      .select2-selection__arrow b {
        border-top-color: transparent;
        border-bottom-color: $select2-arrow-bg;
        border-top-width: 0;
        border-bottom-width: $select2-arrow-size;
      }
    }
  }

  .select2-dropdown {
    margin-top: -1px;
    border-color: $select2-focus-border;
  }

  .select2-search--dropdown .select2-search__field {
    border: 1px solid $select2-border;
    border-radius: $select2-border-radius;
    background-color: #fff;
    color: $select2-color;

    &:focus {
      outline: 0;
    }
  }

  .select2-results__option {
    &[aria-selected=true] {
      color: darken($select2-color, 15%);
      background-color: $select2-option-selected-bg;
    }
  }

  .select2-results__option--highlighted[aria-selected] {
    color: #fff;
    background-color: $select2-option-highlight-bg;
  }
}
